package com.ubxtech.core.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.TreeSet;

/**
 * @author Victor.Xiao
 * @since 2023-10-12 11:10
 **/
@Data
@Schema(title = "TreeNode对象", description = "树基础结构对象")
public class TreeNode<T>  {

    @Schema(title="id")
    protected T id;
    @Schema(title="父id")
    protected T parentId;

    @Schema(title="节点名称")
    protected String name;

    @Schema(title="排序号,从小到大")
    protected Integer orderNo;

    @Schema(title = "子节点")
    protected TreeSet<TreeNode<T>> children = new TreeSet<>(new TreeNodeComparator<>());

}
